interface IEntity {
  id: string;
  entityType: string;
  companyList: ICompany[];
}

interface ICompany {
  id?: string;
  entityNumber: string;
  entityType: string;
  entityName: string;
  addressTree: IAddress[];
}

interface IAddress {
  id?: string;
  locationCode: string;
  parentLocation: string;
  address: string;
  country: string;
  district: string;
  area: string;
  contactInfo: IContactInfo;
  children?: IAddress[];
}

interface IContactInfo {
  setting: ISetting;
  items: IItems;
  contactPersons: IContactPerson[];
  contracts: IServiceContract[];
}

interface IContactPerson {
  id?: string;
  locationCode: string;
  contactPerson: string;
  userName: string;
  tel: string;
  mobileNumber: string;
  email: string;
  faxNumber: string;
}

interface IServiceContract {
  id?: string;
  avatar?: string;
  contactInfo: string;
  startDate: string;
  endDate: string;
  locationCode: string;
  contractTAndC: string;
  cateCode: string;
  contractSum: string;
  contractDescription: string;
  serviceProvider: string;
  team: string;
  PIC: string;
  items: IServiceContractItem[];
}

interface IServiceContractItem {
  id: string;
  itemNumber: string;
  cateCode: string;
  itemDescription: string;
  serialNumber: string;
  alias: string;
  locationCode: string;
  QTY: string;
  cost: string;
  dateExpire: string;
}

interface ISetting {
  id?: string;
  projectName: string;
  priority: string;
  projectType: string;
  projectLocation: string;
  projectDescription: string;
  items: ISettingItem[];
}

interface ISettingItem {
  id?: string;
  department: string;
  userName: string;
  right: string[];
}

interface IUserItem {
  id: string;
  department: string;
  userName: string;
  tel?: string;
  email?: string;
}

interface IItems {
  id?: string;
  type: string;
  address: string;
  items: IItemsItem[];
}

interface IItemsItem extends IServiceContractItem {
  attachment: {
    productPhoto: string;
    attachmentList: IAttachment[];
  };
}

interface IAttachment {
  id?: string;
  date: string;
  fileList: IFile[];
}

interface IFile {
  id?: string;
  src: string;
  ext: string;
  fileName: string;
}
// prospect
interface IProspect {
  id?: string;
  prospectNumber: string;
  customerName: string;
  contactPerson: string;
  jobTitle: string;
  mobileNumber: string;
  work: string;
  fax: string;
  email: string;
}

export {
  IEntity,
  ICompany,
  IAddress,
  IContactInfo,
  IContactPerson,
  IItems,
  IItemsItem,
  IAttachment,
  IFile,
  ISetting,
  ISettingItem,
  IUserItem,
  IServiceContract,
  IServiceContractItem,
  IProspect,
};
